package test

import com.gitee.ixtf.core.J
import kotlin.reflect.KProperty

class TestDelegate {
  var p by Delegate()
}

class Delegate {
  operator fun getValue(ref: TestDelegate, property: KProperty<*>): Any {
    return property
    println("property")
  }

  operator fun setValue(ref: TestDelegate, property: KProperty<*>, s: Any) {
    //        ref.p=s.toString()
    property.getter.call()
    println(property)
  }
}

fun main() {
  val d = TestDelegate()
  d.p = J.file("")
  println(d.p)
}
